<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<%@page import="com.manage.file.MessagerFileVo"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
List<MessagerFileVo> readList = (List)request.getAttribute("readList");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<script src='<%=path %>/js/jquery-1.9.1.min.js'> </script>

<link href="<%=path %>/images/css.css" rel="stylesheet" type="text/css">

<script type="text/javascript">
//区域选择树
function admintree(){
	var res=window.showModalDialog('<%=basePath%>/treecheckbox.jsp',window,'dialogWidth:300px;dialogHeight:500px;status:no;directories:yes;scrollbars:no;help=no;');
	if(res!=undefined){
		var adminshow=res.split('&')[0]
		var ids=res.split('&')[1]
		return ids;
    }
}
function turnfile(fileid){
    //选择转发的对象
    var areaIds = admintree();
    if(areaIds){
    	$.post("<%=path %>/ajax/turnFile.action", 
           {
            'fileid':fileid,
            'messagerIds': areaIds
           }, 
           function(data){
               if(data.ajaxResult == "done"){
    			   location.href="<%=basePath%>/filemanage/getReadedFiles.action";
    		   }
           }, "json");
    }
}
</script>
</head>

<body class="bg_003">
<div id="Layer2" style="position:absolute; width:514px; height:142px; z-index:2; left: 240px; top: 28px"> 
<table width="100%" border="0" bgcolor="#CCCCFF" cellpadding="1" cellspacing="1">
   <tr bgcolor="#Ffffec"> 
   	   <td width="10%" height="30" align="center">序号</td>
       <td width="30%" height="30" align="center">文件名</td>
       <td width="30%" height="30" align="center">审阅时间</td>
       <td width="20%" height="30" align="center">操作</td>
   </tr>
   <%
   for(int i=0;i<readList.size();i++){ 
	   MessagerFileVo filevo = readList.get(i);
   %>
   <tr bgcolor="#Ffffec"> 
       <td width="10%" height="30" align="center"><%=i+1 %></td>
       <td width="30%" height="30"><a href="<%=basePath %>/manage/file/upload/<%=filevo.getFile_name() %>"><font color="#2974C5"><%=filevo.getFile_name() %></font></a></td>
       <td width="30%" height="30"><%=filevo.getRead_time() %></td>
       <td width="20%" height="30" align="center">
           <a id="openfile" href="<%=basePath %>/manage/file/upload/<%=filevo.getFile_name() %>"><font color="#2974C5">打开</font></a>
           &nbsp;
           <a id="openfile" href="#" onclick="turnfile('<%=filevo.getId() %>')"><font color="#2974C5">转发</font></a>
       </td>
   </tr>
   <%} %>
</table> 
</div>
</body>
</html>